﻿#if NET451_OR_GREATER

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
using T.ServiceFramework.Service;

namespace T.SF.Console.HttpHost
{
    [WebApiExceptionFilter]
    public class InvokeController : ApiController
    {
        [AllowAnonymous]
        public object Get()
        {
            return WebHostService.Current.Invoker.Invoke(System.Web.HttpContext.Current,null);
        }

        // POST api/values
        [HttpPost]
        [AllowAnonymous]
        public object Post(Dictionary<string, string> data)
        {
            return WebHostService.Current.Invoker.Invoke(System.Web.HttpContext.Current,data);
        }

        [HttpPut]
        [AllowAnonymous]
        public object Put(Dictionary<string, string> data)
        {
            return WebHostService.Current.Invoker.Invoke(System.Web.HttpContext.Current,data);
        }       
    }
}

#endif